package com.zg.sign.web;

import com.zg.common.core.R;
import com.zg.sign.service.SignService;
import com.zg.sign.vo.UploadUnsignedFilesVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import java.io.IOException;

@RestController
@Api(tags = {"外部签章功能"})
@RequestMapping("/open")
public class SignController {

    @Resource
    private SignService signService;

    /**
     * 上传未签章文件
     * @return
     */
    @ApiOperation("上传未签章文件")
    @PostMapping("/sign/uploadUnsignedFile")
    public R<UploadUnsignedFilesVo> uploadUnsignedFile (@RequestParam("file") MultipartFile file) throws IOException {
        return R.success(signService.uploadUnsignedFile(file));
    }

    /**
     * ca接口
     * @return
     */
    @ApiOperation("ca接口")
    @PostMapping("/sign/loadLastFile")
    public R<?> loadLastFile (){
        return R.success();
    }

    /**
     * 获取印章业务
     * @return
     */
    @ApiOperation("获取印章业务")
    @PostMapping("/sign/getMultUserSealPicInfo")
    public R<?> getMultUserSealPicInfo (){
        return R.success();
    }

    /**
     * 获取签章文件
     * @return
     */
    @ApiOperation("获取签章文件")
    @PostMapping("/sign/downloadBatchFile")
    public R<?> downloadBatchFile (){
        return R.success();
    }
}
